package com.lfl.client;

import com.lfl.annotation.Component;

public class Test {
    public static void main(String[] args) throws Exception {
        //通过反射读取逐渐的信息
        //1.获取User的字节码对象
        Class<?> clazz = Class.forName("com.lfl.bean.User");
        //2.判断User上是否有@Component注解
        if (clazz.isAnnotationPresent(Component.class)) {
            //3.获取@Component注解
            Component component = clazz.getAnnotation(Component.class);
            //4.获取@Component注解的value属性值
            String value = component.value();
            //5.打印
            System.out.println(value);
        }
    }
}
